Skip to content

Conversation

Fridus
Copy link
Contributor

@Fridus Fridus commented Jun 4, 2015

With this feature, it's now possible to set like value an object in titleMap and add its property what we want too.
trackBy parameter used to specify the fields on which we want to compare this the model.

Ex:

scope.thing = { id: 2, a: 1, b: 2 };

scope.schema = {
  "type": "object",
  "properties": {
    "thing": {
      "title": "Thing"
    }
  }
};

scope.form = [{
  key: "thing",
  type: 'select',
  titleMap: [{
    id: 1, name: 'abc', value: { id: 1 }
  },{
    id: 2, name: 'def', value: { id: 2 }
  },{
    id: 3, name: 'ghi', value: { id: 3 }
  }],
  trackBy: 'id'
}];

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 70.91% when pulling 09bd531 on Fridus:feature-select-options-trackBy into e2734c8 on Textalk:development.

davidlgj added a commit that referenced this pull request Jun 12, 2015
Add parameter `trackBy` on form type select.
@davidlgj davidlgj merged commit 2cf33c9 into json-schema-form:development Jun 12, 2015
@davidlgj
Copy link
Contributor

Hi @Fridus, nice PR! Thank you for that 👍 Always nice to see tests as well :)

@Fridus
Copy link
Contributor Author

Fridus commented Jun 12, 2015

@davidlgj :) When will you make a new release ?

@davidlgj
Copy link
Contributor

Hmmm... the plan was to get one out by mid august. The thing is that I have begun working on a new "builder". So it's a big rewrite, but it will make it a lot better. But on the same hand it's been a long time since last release.

So I actually don't what to do. The new "builder" stuff in development branch isn't finished yet, but its supposed to be backwards compatible so in theory it should work, but I don't have enough test to be confident it does. Maybe I could try to make a beta release soonish and if that works make a proper release...

@Fridus
Copy link
Contributor Author

Fridus commented Jun 12, 2015

I ask you this because I need this feature fairly rapidly for a project :)

@davidlgj
Copy link
Contributor

@Fridus just made a release! hope it works for you.

@davidlgj
Copy link
Contributor

Hi @Fridus, I had to revert you commit. It broke the select when not using trackBy, see #471, #473

It looks like using select as in combo with trackBy is not supported. Also I now noticed that two of the tests lacked a done callback, so they seem to work but in fact fail. I didn't have time to fix it so I did a revert.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This need a done callback

@Fridus
Copy link
Contributor Author

Fridus commented Jul 13, 2015

Hi @davidlgj , I'll work on it when I have a little more time ;)

@davidlgj
Copy link
Contributor

👍

mån 13 jul 2015 10:55 Florent notifications@github.com skrev:

Hi @davidlgj https://github.com/davidlgj , I'll work on it when I have
a little more time ;)


Reply to this email directly or view it on GitHub
#418 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants